/*! @brief Details of implementation.
 */

# pragma once

namespace geometry {

    namespace d3 { namespace details {

        template <typename T>
        class CoordinateObject {
        public:
          CoordinateObject(T x, T y, T z) noexcept
            : x_(x), y_(y), z_(z) {}

          CoordinateObject(CoordinateObject const& co) noexcept
            : x_(co.x_), y_(co.y_), z_(co.z_) {}

          CoordinateObject& operator=(CoordinateObject const& co) noexcept {
              if (&co != this) {
                  x_ = co.x_;
                  y_ = co.y_;
                  z_ = co.z_;
              }
              return *this;
          }

          inline T x() const noexcept { return x_; }
          inline T y() const noexcept { return y_; }
          inline T z() const noexcept { return z_; }

          inline T& x() noexcept { return x_; }
          inline T& y() noexcept { return y_; }
          inline T& z() noexcept { return z_; }

        private:
          T x_;
          T y_;
          T z_;
        };

    }}

    namespace d2 { namespace details {

        template <typename T>
        class CoordinateObject {
        public:
          CoordinateObject(T x, T y) noexcept
            : x_(x), y_(y) {}

          CoordinateObject(CoordinateObject const& co) noexcept
            : x_(co.x_), y_(co.y_) {}

          CoordinateObject& operator=(CoordinateObject const& co) noexcept {
              if (&co != this) {
                  x_ = co.x_;
                  y_ = co.y_;
              }

            return *this;
          }

          T x() const noexcept { return x_; }
          T y() const noexcept { return y_; }

          T& x() noexcept { return x_; }
          T& y() noexcept { return y_; }

        private:
          T x_;
          T y_;
        };

    }}

}
